package com.example.teststatisticesinterface.activity;

import com.example.teststatisticesinterface.R;
import com.oppo.statistics.open.MobileClickAgent;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class EventCountActivity extends Activity {
	private Button mBtn_start_23w, mBtn_start_3w, mBtn_start_w, mBtn_timely_23w;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.event_count_activity);
		ininView();
	}

	private void ininView() {
		mBtn_start_23w = (Button) findViewById(R.id.btn_count_start_23w);
		mBtn_start_23w.setOnClickListener(btnClickListener);
		mBtn_start_3w = (Button) findViewById(R.id.btn_count_start_3w);
		mBtn_start_3w.setOnClickListener(btnClickListener);
		mBtn_start_w = (Button) findViewById(R.id.btn_count_start_w);
		mBtn_start_w.setOnClickListener(btnClickListener);
		mBtn_timely_23w = (Button) findViewById(R.id.btn_count_start_tiemly_23w);
		mBtn_timely_23w.setOnClickListener(btnClickListener);
	}

	String eventID = "eventID";
	String eventTag = "eventTag";
	int eventCount = 4;
	OnClickListener btnClickListener = new OnClickListener() {
		@Override
		public void onClick(View v) {
			switch (v.getId()) {
			case R.id.btn_count_start_23w:
				MobileClickAgent.onEvent(EventCountActivity.this, eventID, eventTag, eventCount, MobileClickAgent.STATISTICS_STRATEGY_START_2G_3G_WIFI);
				break;
			case R.id.btn_count_start_3w:
				MobileClickAgent.onEvent(EventCountActivity.this, eventID, eventTag, eventCount, MobileClickAgent.STATISTICS_STRATEGY_START_3G_WIFI);
				break;
			case R.id.btn_count_start_w:
				MobileClickAgent.onEvent(EventCountActivity.this, eventID, eventTag, eventCount, MobileClickAgent.STATISTICS_STRATEGY_START_WIFI);
				break;
			case R.id.btn_count_start_tiemly_23w:

				MobileClickAgent.onEvent(EventCountActivity.this, eventID, eventTag, eventCount, MobileClickAgent.STATISTICS_STRATEGY_TIMELY_2G_3G_WIFI);
				break;

			default:
				break;
			}
		}
	};

	@Override
	public void onBackPressed() {
		super.onBackPressed();
		this.finish();
	}

}
